"ui";
ui.layout(
    <ScrollView>
    <vertical padding="16" h="5000dp">
        <horizontal>
            <text textSize="16sp">设备ip</text>
            <input id="PHONE_IP" text="192.168.137.15"/>
        </horizontal>
         <horizontal>
            <text textSize="16sp">检测动作</text>
            <spinner id="PHONE_CHECK" entries="连入|断开"/>
        </horizontal>
        <horizontal>
            <text textSize="16sp">受控制设备名称</text>
            <input id="MI_C_ID_1" text="公司测试插座"/>
        </horizontal>
         <horizontal>
            <text textSize="16sp">控制设备动作</text>
            <spinner id="MI_C_DO" entries="开|关"/>
        </horizontal>
        <horizontal>
            <text textSize="16sp">检测开始时间</text>
            <timepicker  id="TASK_STARTTIME" timePickerMode="spinner"/>
        </horizontal>
        <horizontal>
            <text textSize="16sp">检测结束时间</text>
            <timepicker  id="TASK_EDNTIME" timePickerMode="spinner"/>
        </horizontal>
        <button id="ok">确定</button>
    </vertical>
    </ScrollView>
);
//指定确定按钮点击时要执行的动作
ui.ok.click(function(){
    //通过getText()获取输入的内容
    var name = ui.name.getText();
    toast(name + "您好!");
});